import request from '@/utils/request'
// 遮挡识别
export function coverRecognize(params) {
  console.log(params)
  const { file } = params
  return request({
    url: `/cover-algo/cover-controller/get-cover`,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'POST',
    data: file,
    timeout: 60 * 3 * 1000
  })
}

//设置遮挡阈值
export function setCoverThreshold(params) {
  return request({
    url:'/cover-algo/cover-controller/edit-threshold',
    method: 'put',
    data: params,
  })
}

// 油污识别
export function muddyRecognize(params) {
  const { file } = params
  return request({
    url: `/muddy-algo/muddy-controller/get-muddy`,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'POST',
    data: file,
    timeout: 60 * 3 * 1000
  })
}

//设置油污阈值
export function setMuddyThreshold(params) {
  return request({
    url:'/muddy-algo/muddy-controller/edit-threshold',
    method: 'put',
    data: params,
  })
}

// 曝光识别
export function brightnessRecognize(params) {
  console.log(params)
  const { file } = params
  // console.log(imageFile, threshold, imageUrl)
  return request({
    url: `/brightness-algo/brightness-controller/get-brightness`,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'POST',
    data: file,
    timeout: 60 * 3 * 1000
  })
}

//设置曝光阈值
export function setBrightnessThreshold(params) {
  return request({
    url:'/brightness-algo/brightness-controller/edit-threshold',
    method: 'put',
    data: params,
  })
}